<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <div  data-th-replace="common/functionDepict"></div>
    <div>
        <div class="row">
            <div class="pt10">
                <div class="col-sm-7">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>礼品卡信息</h5>
                        </div>
                        <div class="ibox-content clearfix p-t">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">礼品卡名称</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ><span th:text="${giftCard['cardName']}"></span><small class="fs12 c-999"></small></p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">礼品卡类型</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <span th:if="${giftCard['cardType']}==1">学员卡-代替注册功能，学员持卡直接加入系统</span>
                                            <span th:if="${giftCard['cardType']}==2">课程卡-需用户自行注册，注册后在个人中心激活获取课程</span>
                                            <span th:if="${giftCard['cardType']}==3">充值卡-需用户自行注册，注册后在个人中心激活，可以支付时代替部分金额。</span>
                                            <small class="fs12 c-999"></small></p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">礼品卡数量</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <span th:text="${giftCard['genNum']}"></span>
                                            <small class="fs12 c-999">张</small>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div th:if="${giftCard['cardType']}==3" class="form-group">
                                    <label class="col-sm-2 control-label">礼品卡金额</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <i class="fa fa-cny"></i>
                                            <span th:text="${giftCard['amount']}"></span>
                                        </p>
                                    </div>
                                </div>
                                <div th:if="${giftCard['cardType']}==3" class="hr-line-dashed"></div>
                                <div th:if="${giftCard['cardType']}==2" class="form-group">
                                    <label class="col-sm-2 control-label text-right">限定课程</label>
                                    <div class="col-sm-9">
                                        <div class="pt10">
                                            <table class="table table-bordered table-hover">
                                                <thead>
                                                <tr>
                                                    <th class="text-center">ID</th>
                                                    <th>课程名称</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                    <tr th:each="course : ${giftCard['courseList']}">
                                                        <td class="text-center" th:text="${course['id']}"></td>
                                                        <td th:text="${course['courseName']}"></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div th:if="${giftCard['cardType']}==2" class="hr-line-dashed"></div>
                                <div th:if="${giftCard['timeType']}==1" class="form-group">
                                        <label class="col-sm-2 control-label">使用时间</label>
                                        <div class="col-sm-10">
                                            <p class="form-control-static" th:text="${giftCard['beginTime']}+'—'+${giftCard['endTime']}">
                                            </p>
                                        </div>
                                    </div>
                                <div th:if="${giftCard['timeType']}==2" class="form-group">
                                    <label class="col-sm-2 control-label">使用天数</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" th:text="${giftCard['timeDays']}+'天'">
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">礼品卡描述</label>
                                    <div class="col-sm-10">
                                        <div class="well" th:text="${giftCard['depict']}">
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-10 col-sm-offset-2">
                                        <button class="btn btn-primary ml10" id="back" type="button">返回列表</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-5">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <div class="pull-right" style="margin-top: -8px">
                                <form id="search-form"   class="form-inline" action="">
                                    <input type="hidden" name="giftCardId" th:value="${giftCard['id']}"/>
                                    <select class="form-control vam" name="useType" >
                                        <option value="">礼品卡使用状态</option>
                                        <option value="2">已使用</option>
                                        <option value="1">未使用</option>
                                    </select>
                                    <button type="button" id="submitGiftCardCode" class="btn btn-sm btn-primary vam" style="margin: 0">搜索</button>
                                </form>
                            </div>
                            <h5>本批次明细</h5>
                        </div>
                        <div class="ibox-content">
                            <div class="well">
                                <div class="row">
                                    <span>共 <small class="c-master" th:text="${giftCard['genNum']}"></small> 张礼品卡 ，使用 <small class="c-green" th:text="${giftCard['useCount']}"></small> 张，未使用 <small class="text-999" th:text="${giftCard['genNum']}-${giftCard['useCount']}"></small> 张</span>
                                    <a class="col-sm-4" href="javascript:void(0)" id="downloadExcel">
                                        <button class="btn  btn-w-m btn-primary" type="button">
                                            <i class="fa fa-download"></i> 导出数据
                                        </button>
                                    </a>
                                </div>
                            </div>
                            <div id="giftCardCode-list-context">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script type="text/javascript"
        th:src="@{{path}/admin/libs/plugins/layer/laydate/laydate.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/op/giftCard/giftCard_info.js?v={v}(path=${staticPath},v=${v})}"> </script>
<script type="text/javascript" th:src="@{{path}/admin/business/common/exportExecl.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
